package com.example.demo2.generator.service.impl;

import com.example.demo2.generator.entity.Dpt;
import com.example.demo2.generator.mapper.DptDao;
import com.example.demo2.generator.service.DptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("dptService")
public class DptServiceImpl implements DptService {
    @Autowired
    private DptDao dptDao;
    @Override
    public List<Dpt> queryAllDpt() {
        List<Dpt> dpt = dptDao.queryAllDpt();
        System.out.println(dpt);
        return dpt;
    }

    @Override
    public List<Dpt> queryByName(String name) {

        return  dptDao.queryByName(name);
    }

    @Override
    public int insert(Dpt dpt) {
        return dptDao.insert(dpt);
    }

    @Override
    public int deleteById(Dpt dpt) {

        return dptDao.deleteById(dpt);
    }

    @Override
    public int updateDpt(Dpt dpt) {

        return dptDao.updateDpt(dpt);
    }
}
